package dbPhase.hypeerweb;


/**
 * HypercubeCapState is a state that represents a node in a HypercubeCap state.
 *
 * @see NodeState
 *
 * @pre singleton - HypercubeCapState
 *
 *
 */
public class HypercubeCapState extends NodeState {

	static HypercubeCapState singleton;

	private HypercubeCapState() {

	}

	static HypercubeCapState getSingleton() {
		if (singleton == null) {
			singleton = new HypercubeCapState();
		}
		return singleton;
	}

	public static final int STATE_ID = 3;

	@Override
	public Node find(Node thisNode ) {
		return thisNode;
	}

	@Override
	public Node search(int lb, int ub, Node thisNode ) {
		return Null_Node.getSingleton();
	}

	@Override
	public int getStateId() {

		return STATE_ID;
	}

	@Override
	public String toString() {
		return "Hypercube Cap State";
	}

	@Override
	public Node findDP(Node thisNode) {
		/// CAP IS DELETION POINT
		return thisNode;
	}

	@Override
	public Node searchDP(int lb, int ub, Node thisNode) {
		// TODO Auto-generated method stub
		System.err.println("Search should never be called on a Cap node: ");

		return Node.NULL_NODE;
	}

}
